﻿namespace CRM.Business.Services
{
    using System.Collections.Generic;
    using CRM.DataAccess.DAOs;
    using CRM.DataAccess.Entities;
    using System;

    public static class ContactService
    {
        /// Gets or sets the role DAO.
        private static ContactDAO ContactDAO = new ContactDAO();

        // Get Contact Detail by ID
        public static CONTACT_DETAIL GetContactDetailByID(long id)
        {
            return ContactDAO.GetContactDetailByID(id);
        }
        //update Contact
        public static int UpdateContact(CONTACT con, APPOINTMENT appoint, QUOTATION_ISSUES qiss, DEPOSIT_COLLECTIONS dc, PROCESS_ORDERS po, PAYMENT_COLLECTIONS paid)
        {
            return ContactDAO.UpdateContact(con, appoint, qiss, dc, po, paid);
        }
        //Get contact by ID
        public static CONTACT GetContactByID(long id)
        {
            return ContactDAO.GetContactByID(id);
        }
        //Get All Contact
        public static List<CONTACT> ListAll()
        {
            return ContactDAO.ListAll();
        }
        //Delete contact
        public static int DeleteContact(long contactID)
        {
            return ContactDAO.DeleteContact(contactID);
        }
        //add list contact from excel file 
        public static int AddListContactFromExcelFile(List<CONTACT> contacts)
        {
            return ContactDAO.AddListContactFromExcelFile(contacts);
        }
        //Add new contact
        public static int AddNewContact(CONTACT contact, APPOINTMENT appoint, QUOTATION_ISSUES qiss, DEPOSIT_COLLECTIONS dc, PROCESS_ORDERS po, PAYMENT_COLLECTIONS paid)
        {
            return ContactDAO.AddNewContact(contact, appoint, qiss, dc, po, paid);
        }
        //Get sales pipeline
        public static List<CONTACT_DETAIL> GetSalesPipeline(long? assignid, string finalStep, bool? value)
        {
            return ContactDAO.GetSalesPipeline(assignid, finalStep, value);
        }
         //Get Contact by condition 
        public static List<CONTACT_DETAIL> GetContactByCondition(DateTime? dateFrom, DateTime? dateTo, string surname, string name, List<long?> ListOrgID, string primaryemail, string officephone, long? assignid)
        {
            return ContactDAO.GetContactByCondition(dateFrom, dateTo, surname, name, ListOrgID,  primaryemail, officephone, assignid);
        }
        //Get Contact by condition for PopUpwindow
        public static List<CONTACT_DETAIL> GetContactByConditionForPopUpWindow(DateTime? dateFrom, DateTime? dateTo, string surname, string name, List<long?> ListOrgID, string primaryemail, string officephone, long? assignid)
        {
            return ContactDAO.GetContactByConditionForPopUpWindow(dateFrom, dateTo, surname, name, ListOrgID, primaryemail, officephone, assignid);
        }
        //Get All Status Contact
        public static List<CONTACT_STATUS> GetAllContactStatus()
        {
            return ContactDAO.GetAllContactStatus();
        }
        //add new Status contact
        public static int AddnewStatus(CONTACT_STATUS cs)
        {
            return ContactDAO.AddNewStatus(cs);
        }
        // get status by name
        public static CONTACT_STATUS GetStatusByName(string name)
        {
            return ContactDAO.GetStatusByName(name);
        }
    }
}
